How Plug-ins Work
VectorScript plug-ins combine regular VectorScript script code with a plug-in “wrapper,” an encoded header which defines the characteristics and behaviors of the plug-in. Information such as the category of the plug-in, properties which define how the plug-in is activated, or any other information needed by the plug-in to function within the VectorWorks application framework is included within the header which “wraps” the script.
Plug-in Types
A key feature of VectorScript plug-ins is their smooth integration into the VectorWorks product interface. VectorScript plug-in menu commands, tools, and objects work just like any built-in VectorWorks tool, object, or menu item. Like built-in menu commands, VectorScript menu commands can be set to require certain file conditions such as 2D/3D view orientation or a selected set of items in order to activate. When a menu command or tool item is selected, the script and any information needed by the plug-in is loaded into memory, and the plug-in script executes. VectorWorks uses information provided by the plug-in to provide the user interactions (such as constraints) and file environment for the menu command or tool to perform its defined actions. VectorScript tools, like their built-in counterparts, make use of the SmartCursor and other tool-centric VectorWorks features.
Plug-in objects have characteristics of both VectorWorks tools and VectorWorks symbols. Plug-in objects can be added to a VectorWorks tool palette and resemble tool items, but in use they will place instances of the object in the file much like the symbol tool places symbols in a file. Object scripts can also be invoked through events that occur in the file. Placed object instances can be modified with the Object Info palette to edit the parametric values that are used to define the object, and these changes will cause the script defining the object to execute for the object to redraw. Global file changes which force a regeneration of the file can also cause the scripts of objects placed in the file to execute. These characteristics give plug-in objects enormous flexibility in how they can be displayed within a file.
Plug-in objects can also be used in conjunction with the Resource Browser to create preconfigured object instances that need minimal editing after placement. Libraries of different object configurations based on a single plug-in object can be easily created and retrieved through the Resource Browser.
Plug-in Location
When VectorWorks is launched, it searches for any VectorScript plug-ins and registers the information necessary to activate and manage the plug-ins. Include files are searched for in the same folder where the associated plug-in is located.
VectorWorks searches for plug-ins in the following order:
1.
2.
3.
The user’s Plug-Ins folder exists in a platform-specific location.
*
On Windows, C:\Documents and Settings\username\Application Data\Nemetschek\VectorWorks\xx\Plug-Ins, where xx represents the current VectorWorks version number, and username refers to the name of the current user logged into the computer
*
On Macintosh, /Users/username/Library/Application Support/VectorWorks/xx/Plug-Ins, where xx represents the current VectorWorks version number, and username refers to the name of the current user logged into the computer
When plug-ins are first created, they are always placed in the user’s Plug-Ins folder.
When VectorWorks is launched or a workspace is activated, a plug-in is available in the current session only if it is located in the Plug-ins folder, its sub-folders, user’s Plug-ins folder and sub-folders, or folders referenced by aliases (Macintosh) or shortcuts (Windows).
If a plug-in is duplicated in more than one location, the instance that occurs first while searching the folders is the one that is used.
The flexibility of the plug-in location provides an advantage when upgrading from a previous version of VectorWorks. Because third-party plug-ins can be stored in a folder separate from the application, they can easily be referenced when installing the upgrade. Copying the plug-ins folders to the current version’s folders, or referencing them with an alias or shortcut, is all that is required when upgrading.

Using VectorScript Plug-ins : Plug-in Properties and Management : How Plug-ins Work

Nemetschek NA
Phone: 410.290.5114
Fax: 410.290.8050